#!/bin/bash
#
# Pulley log preamble and epilog functions
#
# Author:   Dr. Mike Murphy (mmurphy2@coastal.edu)
# Revision: 19 November 2013
#
#   Copyright 2013 Coastal Carolina University
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.


## p_log_preamble
##
## Echoes the log preamble. Returns 0.
##
function p_log_preamble() {
	echo "-----------------------------------------------------------------"
	echo "Pulley Log Entry Start: " $(date)
	echo "Command Line: ${P_CMDLINE}"
	echo "Pulley kernel version: ${PULLEY_VERSION}"
	echo "Bootstrapper version:  ${PBST_VERSION}"
	echo "-----------------------------------------------------------------"
	
	return 0
}


## p_log_epilog <runtime in seconds>
##
## Echoes the log epilog, including the <runtime in seconds>. Returns 0.
##
function p_log_epilog() {
	echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
	echo "Pulley Log Entry End: " $(date)
	echo "Execution Time: $1 seconds"
	echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
	
	return 0
}
